package com.qfjy.project.meeting;

import com.qfjy.entity.MeetingType;
import com.qfjy.service.MeetingTypeService;
import com.qfjy.uitl.ResultCode;
import com.qfjy.uitl.ResultJson;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@Slf4j
@RequestMapping("meetingtype")
@Api(tags = {"会议的课题类别"})
public class MeetingTypeController {
     @Autowired
    private MeetingTypeService meetingTypeService;

    /**
     * 查询所有有效课题类别
     * @return
     */
     @RequestMapping("list")
    @ResponseBody

    public ResultJson selectListByStatusAndSortNumAsc(){
         log.info("查询课题列表数据");
         List<MeetingType> meetingTypes = meetingTypeService.selectMeetingTypeByStautsSortNumAsc();
         if(meetingTypes.size()==0){
             System.out.println("000000000000000");
            return new ResultJson(null, ResultCode.NOT_DATA);
         }
         return new ResultJson(meetingTypes,ResultCode.SUCCESS);
     }

}